import Vue from 'vue'
import Vuex from 'vuex'
import config from '@/js/config'
Vue.use(Vuex)
let userNum = config.type === '2' ? 'zhaozm01' : sessionStorage.getItem('userNum')
const store = new Vuex.Store({
  state: {
    // 从微信选择的发票列表
    routerAni: '',
    chooseInvoiceInfo: [],
    isLoading: false,
    scanBillCode: sessionStorage.getItem('scanBillCode') || '',
    userNum,
    checkkey: 'vanke_20171127111533'
  },
  mutations: {
    routerAni (state, info) {
      state.routerAni = info
    },
    userNum (state, info) {
      state.userNum = info
      sessionStorage.setItem('userNum', info)
    },
    isLoading (state, info) {
      state.isLoading = info
    },
    scanBillCode (state, info) {
      state.scanBillCode = info
      sessionStorage.setItem('scanBillCode', info)
    }
  }
})
export default store
